package com.danhar.forward.util;

public enum ResponseCode {
    SUCCEED_CODE(200, "SUCCESS"),
    ERROR_CODE(400, "请求出现错误"),
    TOKEN_ERROR_CODE(401, "TOKEN无效"),
    RESPONSE_TIMEOUT(408, "请求超时"),
    RESPONSE_PARAMETER_ERROR(422, "请求参数校验错误"),
    RESPONSE_TOO_MUCH(429, "请求过多"),
    RESPONSE_HEADER_FIELD_IS_TOO_LARGE(431, "请求标头字段太大"),
    SERVICE_INTERNAL_ERROR(500, "内部服务器错误");

    private Integer code;
    private String msg;

    ResponseCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    ResponseCode(int code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
